package cn.wolfcode.p2p.web.controller;

import cn.wolfcode.p2p.base.query.RealAuthQuery;
import cn.wolfcode.p2p.base.service.IRealAuthService;
import cn.wolfcode.p2p.base.util.JSONResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * 后台:真实身份审核
 */
@Controller
public class RealAuthAuditController {
    @Autowired
    private IRealAuthService realAuthService;

    @RequestMapping("/realAuth")
    public String list(@ModelAttribute("qo") RealAuthQuery qo, Model model) {
        model.addAttribute("pageInfo", realAuthService.query(qo));
        return "realAuth/list";
    }

    //实名认证审核
    @RequestMapping("/realAuth_audit")
    @ResponseBody
    public JSONResult audit(Long id,int state,String remark){
        realAuthService.audit(id,state,remark);
        return new JSONResult();

    }
}
